package com.lagou.client;

import com.lagou.service.UserService;


public class ClientBootStrap {

    public static void main(String[] args) throws Exception {

        //加载zookeeper上的服务节点信息
        UserClientUtil.loadZkProvider();

        RpcConsumer rpcConsumer = new RpcConsumer();
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class);

        while (true) {
            Thread.sleep(2000);

            try {
                proxy.sayHello("are you ok?");
            } catch (Exception e) {
                System.out.println(e.getMessage());
            }

            System.out.println("已响应");
        }
    }


}
